var e = require("../../@babel/runtime/helpers/regeneratorRuntime"),
  r = require("../../@babel/runtime/helpers/asyncToGenerator"),
  n = require("../../@babel/runtime/helpers/toConsumableArray"),
  t = require("../../config/index"),
  a = [{
    title: "全部",
    mode: "",
    "filter-key": "all"
  }].concat(n(t.tabList));
Page({
  componentPage: ["onReachBottom", "onPullDownRefresh", "onPageScroll"],
  data: {
    tabActive: 0,
    callList: a
  },
  onShow(){
    console.log('onShow')
  },
  onLoad: function () {
    var n = this;
    return r(e().mark((function r() {
      return e().wrap((function (e) {
        
        for (;;) switch (e.prev = e.next) {
          case 0:
            return e.next = 2, n.refresh();
          case 2:
          case "end":
            return e.stop()
        }
      }), r)
    })))()
  },
  onTabChange: function (n) {
    var t = this;
    return r(e().mark((function r() {
      var a, o;
      return e().wrap((function (e) {
        for (;;) switch (e.prev = e.next) {
          case 0:
            if (e.t0 = n.detail, !e.t0) {
              e.next = 4;
              break
            }
            return e.next = 4, t.refresh(null === (a = n.detail) || void 0 === a || null === (o = a.row) || void 0 === o ? void 0 : o.mode);
          case 4:
          case "end":
            return e.stop()
        }
      }), r)
    })))()
  },
  refresh: function () {
    var n = arguments,
      t = this;
    return r(e().mark((function a() {
      var o;
      return e().wrap((function (a) {
        for (;;) switch (a.prev = a.next) {
          case 0:
            o = n.length > 0 && void 0 !== n[0] ? n[0] : "", $.selectComponent.call(t, "#card-list").then(function () {
              var n = r(e().mark((function r(n) {
                return e().wrap((function (e) {
                  for (;;) switch (e.prev = e.next) {
                    case 0:
                      return e.next = 2, n.onRefresh(1, {
                        mode: o
                      });
                    case 2:
                    case "end":
                      return e.stop()
                  }
                }), r)
              })));
              return function (e) {
                return n.apply(this, arguments)
              }
            }());
          case 2:
          case "end":
            return a.stop()
        }
      }), a)
    })))()
  }
});